<div class="p-login">
  <div class="login-form">
    <div class="login-logo"></div>
    <form login-validator submitted="vm.submitted" novalidate autocomplete="off">
      <div class="form-group input-box">
        <i class="user-icon"></i>
        <input ng-model="vm.username" name="username" placeholder="用户名" autofocus>
      </div>
      <div class="form-group input-box">
        <i class="pwd-icon"></i>
        <input type="password" ng-model="vm.password" name="password" placeholder="密码">
      </div>
      <div class="form-group login-tips">
        <div class="error-message input-message"></div>
        <div ng-if="vm.submitted && vm.error" class="error-message" ng-cloak>
          用户名或密码错误!
        </div>
        <div ng-if="vm.submitted && vm.authError" class="error-message" ng-cloak>
          用户未分配权限!
        </div>
      </div>
      <div class="form-group check">
        <input type="checkbox" ng-model="vm.isPreserved" id="preserve" />
        <label for="preserve">记住用户名和密码</label>
      </div>
      <div ng-if="!vm.logining">
        <input type="submit" class="btn-login" id="login" value="登录" ng-click="vm.login()">
      </div>
      <div ng-if="vm.logining">
        <button class="btn-login">登录中...</button>
      </div>
    </form>
    <div class="login-footer"></div>
  </div>
</div>
